import json
import smtplib
import urllib
from email.mime.text import MIMEText
 
def getHtml(url):
    page = urllib.urlopen(url)
    html = page.read()
    return html.decode("utf-8")


str = getHtml("http://api.map.baidu.com/telematics/v3/weather?location=苏州&output=json&ak=Dy2Zop7tjKlj2EZxwe88Hbjz")
_json = json.loads(str)["results"]
_json = _json[0]["weather_data"];

print("苏州天气：".decode("utf-8"))
for i in range(0, 4):
    print(_json[i]["date"] + " " + _json[i]["weather"] + " " + _json[i]["temperature"]);
    
